package com.xsq.netty.channel;

import com.xsq.netty.ClientMsgEncoder;
import com.xsq.netty.MessageDecoder;

import io.netty.channel.Channel;
import io.netty.channel.ChannelInitializer;
import io.netty.channel.ChannelPipeline;

/**
 * Created by Shiquan.Xiao on 2023/2/23.
 */
public class NettyChannelInitializer extends ChannelInitializer<Channel> {

    @Override
    protected void initChannel(Channel ch) throws Exception {
        ChannelPipeline pipeline = ch.pipeline();
        pipeline.addLast(new ClientMsgEncoder());
        pipeline.addLast(new MessageDecoder());
//        pipeline.addLast(
//                new LineBasedFrameDecoder(32768),
//                new StringEncoder(),
//                new StringDecoder()
//        );

    }

}
